#include<iostream>
#include<cstdio>
using namespace std;
const int N = 2e5 + 10;
int arr[N];
int n;
bool check()
{
	for (int i = 1; i <= n - 1; i++) {
		if (arr[i] % 2) {
			arr[i]--;
			arr[i + 1]--;
		}
	}
	for (int i = 1; i <= n; i++) {
		if (arr[i] < 0 || arr[i] % 2) {
			return 0;
		}
	}
	return 1;
}
int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &arr[i]);
	}
	if (check()) puts("YES");
	else puts("NO");
	return 0;
}